﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TrangChu : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var th = new System.Web.UI.Control();
        if (Request.QueryString["MaKieu"] != null)
        {
            th = Page.LoadControl("~/Control/SanPham.ascx");
        }
        else if (Request.QueryString["MaChatLieu"] != null)
        {
            th = Page.LoadControl("~/Control/SanPham.ascx");
        }
        else if (Request.QueryString["MaSP"] != null)
        {
            th = Page.LoadControl("~/Control/ChiTietSanPham.ascx");
        }
        else if (Request.QueryString["TimKiem"] != null)
        {
            th = Page.LoadControl("~/Control/SanPham.ascx");
        }
        else if (Request.QueryString["TimKiemnangcao"] != null)
        {
            th = Page.LoadControl("~/Control/SanPham.ascx");
        }
        else if (Request.QueryString["GioHang"] != null)
        {
            th = Page.LoadControl("~/Control/ChiTietGioHang.ascx");
        }
        else if (Request.QueryString["ThanhToan"] != null)
        {
            th = Page.LoadControl("~/Control/ThanhToan.ascx");
        }
        else if (Request.QueryString["dangky"] != null)
        {
            th = Page.LoadControl("~/Control/DangKiThanhVien.ascx");
        }
        else if (Request.QueryString["GioHangRong"] != null)
        {
            th = Page.LoadControl("~/Control/GioHangRong.ascx");
        }

        else if (Request.QueryString["noptien"] != null)
        {
            th = Page.LoadControl("~/Control/NopTaiKhoan.ascx");
        }
        else if (Request.QueryString["gioithieu"] != null)
        {
            th = Page.LoadControl("~/Control/GioiThieu.ascx");
        }
        else if (Request.QueryString["doimk"] != null)
        {
            th = Page.LoadControl("~/Control/DoiMatKhau.ascx");
        }

        else if (Request.QueryString["doimk"] != null)
        {
            th = Page.LoadControl("~/Control/DoiMatKhau.ascx");
        }
        //else if (Request.QueryString["ThongTinKH"] != null)
        //{
        //    th = Page.LoadControl("~/Control/ThongTinKhachHang.ascx");
        //}


        else
        {
            Session["timkiem"] = null;
            Session["TenSP"] = null;
            Session["giatu"] = null;
            Session["giaden"] = null;
            Session["timkiemnangcao"] = null;

            th = Page.LoadControl("~/Control/SanPham.ascx");
        }
        Panel1.Controls.Add(th);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
       
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/TrangChu.aspx?gioithieu=GioiThieu");
    }
   
    
}